home *** CD-ROM | disk | FTP | other *** search
- class disney.rabbitRivalry.Sounds extends smashing.sound.SoundEngine
- {
- var __currentMusic;
- var muteMusic;
- var muteSound;
- var __currentVO;
- static var __instance;
- var __DEPTH = 20;
- var __DO_OVERWRITE = false;
- function Sounds()
- {
- super();
- }
- static function init()
- {
- disney.rabbitRivalry.Sounds.__instance = new disney.rabbitRivalry.Sounds();
- }
- static function getInstance()
- {
- return disney.rabbitRivalry.Sounds.__instance;
- }
- function generateSounds(path)
- {
- super.generateSounds(path,this.__DEPTH,this.__DO_OVERWRITE);
- this.createGroup("music");
- this.createSound("splash","Splash_loop.wav","music");
- this.createSound("game","Game_loop.wav","music");
- this.changeVolume(50,"music");
- this.createSound("yinyangyo","YinYangYo_Intro_short.wav");
- this.createSound("bonk","roach_hit.wav");
- this.createSound("yoHit1","Yo_hey.wav");
- this.createSound("yoHit2","Yo_what-the-heck.wav");
- this.createSound("yangattack","yang_attack.wav");
- this.createSound("yinattack","yin_attack.wav");
- this.createSound("yoWin1","Yo_i-hope-you-got-your-learing-caps-on.wav");
- this.createSound("yoWin2","Yo_responsibility.wav");
- this.createSound("yoWin3","Yo_material-posessions.wav");
- this.createSound("yoWin4","Yo_self-sacrifice.wav");
- this.createSound("bash","CRASH R.wav");
- this.createSound("yin_attack1","Yin_ha-yee.wav");
- this.createSound("yin_attack2","Yin_yincinerate.wav");
- this.createSound("yin_attack3","Yin_foofield.wav");
- this.createSound("yang_attack1","Yang_he-hoo-ha.wav");
- this.createSound("yang_attack2","Yang_ah-yeah.wav");
- this.createSound("yang_attack3","Yang_foonado.wav");
- this.__currentMusic = "";
- this.muteMusic = false;
- }
- function playLevelEndSound()
- {
- var _loc2_ = disney.rabbitRivalry.GameState.getInstance().levelNum;
- this.playSound("yoWin" + _loc2_);
- }
- function playSound(name, loops, t_queued)
- {
- if(this.muteSound == true)
- {
- return undefined;
- }
- super.playSound(name,loops,t_queued);
- }
- function p(name)
- {
- this.playSound(name,1);
- }
- function q(name)
- {
- this.queueSound(name);
- }
- function c(name, cbpath, cbfunc)
- {
- this.callbackSound(name,1,cbpath,cbfunc);
- }
- function playMusic(name)
- {
- if(this.muteMusic)
- {
- this.__currentMusic = name;
- return undefined;
- }
- if(this.__currentMusic != "" && this.__currentMusic != undefined)
- {
- this.stopMusic();
- }
- this.__currentMusic = name;
- this.playSound(this.__currentMusic,0);
- }
- function restartMusic()
- {
- if(this.muteMusic)
- {
- return undefined;
- }
- if(this.__currentMusic == "" || this.__currentMusic == undefined)
- {
- return undefined;
- }
- this.playMusic(this.__currentMusic);
- }
- function stopMusic()
- {
- this.stopSound(this.__currentMusic);
- }
- function playOptional(t_name)
- {
- if(!this.isQueuePlaying)
- {
- this.queueSound(t_name);
- }
- }
- function playVoiceOver(name)
- {
- this.stopSound(this.__currentVO);
- this.__currentVO = name;
- if(disney.rabbitRivalry.GameState.getInstance().isYang)
- {
- this.__currentVO = "yang_" + this.__currentVO;
- }
- else
- {
- this.__currentVO = "yin_" + this.__currentVO;
- }
- this.playSound(this.__currentVO);
- }
- function musicOff()
- {
- this.muteMusic = true;
- this.stopMusic();
- }
- function musicOn()
- {
- this.muteMusic = false;
- this.playMusic(this.__currentMusic);
- }
- }
-